package com.jf3q.admin.controller;

import com.jf3q.admin.service.EduCourseService;
import com.jf3q.common.vo.ResultVo;
import com.jf3q.common.vo.CourseInfoVo;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;


/**
 * @author:xiaojie
 * @create: 2023-05-03 15:06
 * @Description:
 */
@RestController
@RequestMapping("/course")
public class CourseController {

    @Resource
    EduCourseService eduCourseService;


    @Operation(summary = "添加课程基本信息")
    @PostMapping
    public ResultVo saveCourse(@RequestBody CourseInfoVo courseInfoVo){
       String  courseId= eduCourseService.saveCourse(courseInfoVo);
       return ResultVo.success("添加成功",courseId);
    }

    @Operation(summary = "删除课程")
    @DeleteMapping("{id}")
    public ResultVo del(@PathVariable String id){
        eduCourseService.del(id);
        return ResultVo.success("删除成功",null);
    }

//    @ApiOperation(value = "查课程大纲")
//    @GetMapping("/chapter/{courseId}")
//    public ResultDto getCha(@PathVariable String courseId){
//
//
//    }


}
